package org.charles.zhifou.model.dto.userAnswer;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import lombok.Data;
import org.charles.zhifou.enums.AppTypeEnum;
import org.charles.zhifou.common.enums.CodeToEnumDeserializer;
import org.charles.zhifou.enums.ScoringStrategyEnum;
import org.charles.zhifou.enums.SqlSortOrderEnum;

import java.io.Serial;
import java.io.Serializable;

/**
 * 查询用户答案请求
 *
 * @author Charles
 * @version 1.0
 */
@Data
public class UserAnswerQueryRequest implements Serializable {

    @Schema(description = "用户回答 id")
    private Long id;

    @Schema(description = "应用 id")
    private Long appId;

    @Schema(description = "应用类型: 0-得分类, 1-角色测评类")
    private AppTypeEnum appType;

    @Schema(description = "评分策略: 0-自定义, 1-AI")
    private ScoringStrategyEnum scoringStrategy;

    @Schema(description = "用户答案 (JSON 数组)")
    private String choices;

    @Schema(description = "评分结果 id")
    private Long resultId;

    @Schema(description = "结果名称，如物流师")
    private String resultName;

    @Schema(description = "结果描述")
    private String resultDesc;

    @Schema(description = "结果图标")
    private String resultPicture;

    @Schema(description = "得分")
    private Integer resultScore;

    @Schema(description = "用户 id")
    private Long userId;

    @Schema(description = "id")
    private Long notId;

    @Schema(description = "搜索词")
    private String searchText;

    @Schema(description = "当前页号")
    @Min(value = 1, message = "当前页号必须大于 0")
    private int current = 1;

    @Schema(description = "页面大小")
    @Min(value = 1, message = "页面大小必须大于 0")
    private int pageSize = 10;

    @Schema(description = "排序字段")
    private String sortField;

    @Schema(description = "排序顺序 (默认升序)")
    @JsonDeserialize(using = CodeToEnumDeserializer.class)
    private SqlSortOrderEnum sortOrder = SqlSortOrderEnum.ASC;

    @Serial
    private static final long serialVersionUID = 1L;
}